home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / stunnel-4.04 / _src / tools / stunnel.init.in < prev    next >
Encoding:
Text File  |  2002-08-10  |  970 b   |  44 lines

  1. #!/bin/sh
  2. # Sample stunnel SysV startup file
  3. # Copyright by Michal Trojnara 2002
  4.  
  5. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  6. PREFIX=@prefix@
  7. DAEMON=$PREFIX/sbin/stunnel
  8. PIDFILE=$PREFIX/var/run/stunnel/stunnel.pid
  9.  
  10. test -f $DAEMON || exit 0
  11.  
  12. case "$1" in
  13.     start)
  14.         echo -n "Starting universal SSL tunnel: stunnel"
  15.         $DAEMON || echo -n " failed"
  16.         echo "."
  17.         ;;
  18.     stop)
  19.         echo -n "Stopping universal SSL tunnel: stunnel"
  20.         if test -r $PIDFILE; then
  21.             kill `cat $PIDFILE` 2> /dev/null || echo -n " failed"
  22.         else
  23.             echo -n " no PID file"
  24.         fi
  25.         echo "."
  26.         ;;
  27.      restart|force-reload)
  28.         echo "Restarting universal SSL tunnel"
  29.         $0 stop
  30.         sleep 1
  31.         $0 start
  32.         echo "done."
  33.         ;;
  34.     *)
  35.         N=${0##*/}
  36.         N=${N#[SK]??}
  37.         echo "Usage: $N {start|stop|restart|force-reload}" >&2
  38.         exit 1
  39.         ;;
  40. esac
  41.  
  42. exit 0
  43.  
  44.